<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建虚拟 DOM 对象 - 原生 JS</title>
</head>
<body>
    <div id="root"></div>

    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>

    <script>
        // 原生 js 创建
        // let vDOM = React.createElement(标签名, 标签属性, 子元素, 子元素....);

        //创建单层结构
        // let vDOM = React.createElement('div', {title: '新闻', className: 'biaoti'}, '我是一个虚拟 DOM 对象哦 耶!!!');

        //创建二层结构
        let vDOM = React.createElement('div', null, 
            React.createElement('h2', null, '喜悦整容 - 惊爆打人事件'),
            React.createElement('p', null, '某城市, 顾客整容失败, 被非法拘禁, 还遭殴打!!')
        )
        ReactDOM.render(vDOM, document.querySelector('#root'));
</script>
</body>
</html>